package engine.scene;

import math.vector.vec3f;

public class Scene3D
{
    
    private TriGroupBuffer triGroupBuffer;
    //<editor-fold defaultstate="collapsed" desc="getGeometry">
    public TriGroupBuffer getGeometry()
    {
        return this.triGroupBuffer;
    }
    //</editor-fold>
    
    private SoundSourceBuffer soundSourceBuffer;
    //<editor-fold defaultstate="collapsed" desc="getSoundSources">
    public SoundSourceBuffer getSoundSources()
    {
        return this.soundSourceBuffer;
    }
    //</editor-fold>
    
    private Camera3D camera;
    //<editor-fold defaultstate="collapsed" desc="getCamera">
    public Camera3D getCamera()
    {
        return this.camera;
    }
    //</editor-fold>
    //<editor-fold defaultstate="collapsed" desc="setCameraTo">
    public void setCameraTo(Camera3D camera)
    {
        this.camera = camera;
    }
    //</editor-fold>
    
    private SoundListener soundListener;
    //<editor-fold defaultstate="collapsed" desc="setSoundListenerPosition">
    public void setSoundListenerPosition(vec3f position)
    {
        this.soundListener.setPosition(position);
    }
    //</editor-fold>
    //<editor-fold defaultstate="collapsed" desc="setSoundListenerDirection">
    public void setSoundListenerDirection(vec3f direction)
    {
        this.soundListener.setDirection(direction);
    }
    //</editor-fold>
    //<editor-fold defaultstate="collapsed" desc="setSoundListenerVelocity">
    public void setSoundListenerVelocity(vec3f velocity)
    {
        this.soundListener.setVelocity(velocity);
    }
    //</editor-fold>
    
    public Scene3D()
    {
        this.triGroupBuffer = new TriGroupBuffer();
        this.soundSourceBuffer = new SoundSourceBuffer();
        
        this.soundListener = new SoundListener();
    }
    
    public void addGeometry(TriGroup triGroup)
    {
        this.triGroupBuffer.addTriGroup(triGroup);
    }
    
    public void clearGeometry()
    {
        this.triGroupBuffer.clearTriGroups();
    }
    
    public void addSoundSource(SoundSource soundSource)
    {
        this.soundSourceBuffer.addSoundSource(soundSource);
    }
    
    public void clearSoundSources()
    {
        this.soundSourceBuffer.clearSoundSources();
    }
    
    public void destroy()
    {
        
        this.camera = null;
        this.clearGeometry();
        this.triGroupBuffer = null;
    }
    
}
